package com.wd.live.view.Activity

import android.content.Intent
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import androidx.fragment.app.Fragment
import androidx.fragment.app.FragmentPagerAdapter
import com.wd.live.R
import com.wd.live.base.BaseActivity
import com.wd.live.databinding.ActivityRefineBinding
import com.wd.live.view.Fragment.HoroscopeFragment
import com.wd.live.view.Fragment.SexFragment
import com.wd.live.view.Fragment.labelFragment
import com.wd.live.viewmodel.RefineViewModel

class RefineActivity : BaseActivity<RefineViewModel,ActivityRefineBinding>(R.layout.activity_refine) {
    override fun dataObserver() {

    }

    override fun initViews() {
        binding.tiao.setOnClickListener {

            startActivity(Intent(this,MainActivity::class.java))

        }
        val list = mutableListOf(SexFragment(), HoroscopeFragment(), labelFragment())

        binding.vp.adapter=object : FragmentPagerAdapter(supportFragmentManager){

            override fun getCount()=list.size

            override fun getItem(position: Int): Fragment = list.get(position) as Fragment

            override fun getPageTitle(position: Int)= mutableListOf("","","",)[position]

        }

        binding.an.setupWithViewPager(binding.vp)
    }


}